package com.mryan.ps_common.configure;

import com.mryan.ps_common.interceptor.PSServerProtectInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @BelongsProject: ps_cloud
 * @BelongsPackage: com.mryan.ps_common.configure
 * @Author: Yan
 * @CreateTime: 2021-04-25 22:02
 * @Description:
 */
public class PSServerProtectConfigure implements WebMvcConfigurer {

	@Bean
	public HandlerInterceptor psServerProtectInterceptor() {
		return new PSServerProtectInterceptor();
	}

	@SuppressWarnings("SpringConfigurationProxyMethods")
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(psServerProtectInterceptor());
	}
}
